package com.kai.mqtt.protocol;

import com.kai.mqtt.constant.AttributeKeyConstant;
import io.netty.channel.Channel;
import io.netty.handler.codec.mqtt.MqttMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author weijk
 * @since 2024/6/3
 */
@Slf4j
@Component
public class Disconnect extends AbstractProtocol {

    @Override
    public void process(Channel channel, MqttMessage message) {
        log.info("receive - disconnect, clientId: {}", channel.attr(AttributeKeyConstant.CLIENT_ID).get());
        channel.close();
    }
}
